<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf"> 抽奖活动列表</div>
                </div>
                <div class="widget-body am-fr">
                    <!-- 工具栏 -->
                    <div class="page_toolbar am-margin-bottom am-cf">
                        <form class="toolbar-form" action="">
                            <input type="hidden" name="s" value="">
                            <div class="am-u-sm-12 am-u-md-3">
                                <div class="am-form-group">
                                    <div class="am-btn-toolbar">

                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                         tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户ID</th>
                                <th>用户昵称</th>
                                <th>用户头像</th>
                                <th>奖品ID</th>
                                <th>奖品名称</th>
                                <th>奖品logo</th>
                                <th>奖品类型</th>
                                <th>奖品</th>
                                <th>中奖时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['id'] ?></td>
                                    <td class="am-text-middle"><?= $item['user_id'] ?></td>
                                    <td class="am-text-middle"><?= $item['user']['nickName'] ?></td>
                                    <td class="am-text-middle">
                                        <a href="<?= $item['user']['avatarUrl'] ?>"
                                           title="点击查看大图" target="_blank">
                                            <img src="<?= $item['user']['avatarUrl'] ?>"
                                                 width="50" height="50" alt="奖品logo">
                                        </a>
                                    </td>
                                    <td class="am-text-middle"><?= $item['lottery_goods_id'] ?></td>
                                    <td class="am-text-middle"><?= $item['lottery_goods']['name'] ?></td>
                                    <td class="am-text-middle">
                                        <a href="<?= $item['lottery_goods']['logo']['file_path'] ?>"
                                           title="点击查看大图" target="_blank">
                                            <img src="<?= $item['lottery_goods']['logo']['file_path'] ?>"
                                                 width="50" height="50" alt="奖品logo">
                                        </a>
                                    </td>
                                    <td class="am-text-middle"><?= $item['lottery_goods']['type']['value'] ?></td>
                                    <td class="am-text-middle">
                                        <?php switch ($item['lottery_goods']['type']['text']){
                                            case 1:
                                                echo '无';
                                                break;
                                            case 2:
                                                echo $item['lottery_goods']['prize'] . '积分';
                                                break;
                                            case 3:
                                                echo $item['lottery_goods']['prize']['name'];
                                                break;
                                            case 4:
                                                echo $item['lottery_goods']['prize']['goods_name'];
                                                break;
                                            default:
                                                echo '';
                                                break;
                                        }?>
                                    </td>
                                    <td class="am-text-middle"><?= $item['create_time'] ?></td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="10" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr"><?= $list->render() ?> </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {

        // 删除元素
        var url = "<?= url('apps.bargain.active/delete') ?>";
        $('.item-delete').delete('active_id', url);

    });
</script>

